<template>
	<view class="bottom-btn-box" :style="{bottom}">
		<button :type="type" :class="type" class="bottom-btn" @click="clickFn">
			<slot>默认文字</slot>
		</button>
	</view>
</template>

<script setup lang="ts">
	const emits = defineEmits(['btnClick'])
	// 底部距离
	defineProps({
		bottom: {
			type: String,
			default: '0rpx'
		},
		type: {
			type: String,
			default: 'primary'
		}
	})

	function clickFn() {
		emits('btnClick')
	}
</script>

<style scoped lang="scss">
	.bottom-btn-box {
		position: fixed;
		bottom: 0rpx;
		left: 0;
		width: 100%;
		height: 166rpx;
		padding: 14rpx 32rpx 70rpx;
		background-color: #fff;
		box-shadow: 0rpx -4rpx 16rpx 0rpx rgba(0, 0, 0, 0.05);
		box-sizing: border-box;
		z-index: 9;
	}

	.bottom-btn {
		font-size: 28rpx;
		line-height: 84rpx;
		color: #fff;
		border-radius: 48rpx;
		background-color: $primary-color;

		&.success {
			background-color: #60E11C;
		}

		&.info {
			background-color: #CECECE;
		}
	}
</style>